//
//  MovieModel.m
//  噗嗤
//
//  Created by cjp on 16/8/12.
//  Copyright © 2016年 cjp. All rights reserved.
//

#import "MovieModel.h"
#import <MJExtension.h>

@implementation MovieModel

// 成员变量
{
    CGFloat _cellHeight;
    CGRect _pictureF;
}

- (CGFloat)cellHeight{
    if (!_cellHeight) {
        // 文字的最大尺寸
        CGSize maxSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 2 * MovieCellMargin, MAXFLOAT);
        // 计算文字的高度
        CGFloat titleH = [self.title boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil].size.height;
        
        // 文字部分的高度
        _cellHeight = MovieCellTextY + titleH + MovieCellMargin + 10;
        
        // 图片高度
        _cellHeight += pictureH;
    }
    
    
    // 底部工具条的高度
    _cellHeight += MovieCellBottonBarH + MovieCellMargin + 10;
    
    return _cellHeight;
}

@end
